package com.zhao.whiteBox.originator;

import com.zhao.whiteBox.memento.GameRoleMemento;

public class GameRole {

    private Integer rtk;

    private Integer def;

    public Integer getRtk() {
        return rtk;
    }

    public void setRtk(Integer rtk) {
        this.rtk = rtk;
    }

    public Integer getDef() {
        return def;
    }

    public void setDef(Integer def) {
        this.def = def;
    }

    public void initProp() {
        this.rtk = 100;
        this.def = 100;
    }

    public void fight() {
        this.rtk = 0;
        this.def = 0;
    }

    public GameRoleMemento setMemento() {
        return new GameRoleMemento(rtk, def);
    }

    public void recoverMemento(GameRoleMemento gameRoleMemento) {
        this.rtk = gameRoleMemento.getRtk();
        this.def = gameRoleMemento.getDef();
    }

    public void printStat() {
        System.out.println("伤害：" + this.rtk);
        System.out.println("防御：" + this.def);
    }
}
